package com.cango.student.inter;

import com.alibaba.fastjson.JSON;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

public class Intermain implements inter4 {
    @Override
    public void inter4() {
        System.out.println("inter4");
    }
//    @Override
//    public void get() {
//        System.out.println("Intermain get");
//    }

    @Override
    public void inter2() {
        System.out.println("inter2");
    }

    @Override
    public void inter1() {
        System.out.println("inter1");
    }

    @Override
    public void inter3() {
        System.out.println("inter3");
    }


    public static void main(String[] args) {

        inter1 m1 = new Intermain();
        m1.get();
        m1.inter1();
        inter3 m3 = new Intermain();
        m3.inter1();

        // isXXX 能够被JSON序列化
        Ym ym = new Intermain.Ym();
        System.out.println(JSON.toJSONString(ym));
        System.out.println(JSON.toJSONString(BuilderSample.newBuilder().header("head").footer("foot").build()));
    }

    class Cb implements Callable<String> {
        /**
         * Computes a result, or throws an exception if unable to do so.
         *
         * @return computed result
         * @throws Exception if unable to compute a result
         */
        @Override
        public String call() throws Exception {
            return "OK";
        }
    }

    static class Ym {
        public boolean isOpen() {
            return true;
        }

        public boolean getOpen() {
            return true;
        }
    }
}
